////////////////////////////////////////////////////////////////////////////////
// Filename: rendertextureclass.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _RENDERTEXTURECLASS_H_
#define _RENDERTEXTURECLASS_H_


//////////////
// INCLUDES //
//////////////
#include <d3d10.h>


////////////////////////////////////////////////////////////////////////////////
// Class name: RenderTextureClass
////////////////////////////////////////////////////////////////////////////////
class RenderTextureClass
{
public:
	RenderTextureClass();
	RenderTextureClass(const RenderTextureClass&);
	~RenderTextureClass();

	bool Initialize(ID3D10Device*, int, int);
	void Shutdown();

	void SetRenderTarget(ID3D10Device*, ID3D10DepthStencilView*);
	void ClearRenderTarget(ID3D10Device*, ID3D10DepthStencilView*, float, float, float, float);
	ID3D10ShaderResourceView* GetShaderResourceView();
	bool buildDepthMap(ID3D10Device* device, int textureWidth, int textureHeight);
	bool buildColorMap(ID3D10Device* device, int textureWidth, int textureHeight);
	void SetDepthStencil(ID3D10Device* device, ID3D10RenderTargetView* renderTargetView);
	ID3D10ShaderResourceView* GetDepthStencilView();
	void ClearDepthStencil(ID3D10Device* device, ID3D10RenderTargetView* renderTargetView, float red, float green, float blue, float alpha);
	ID3D10ShaderResourceView* GetDepthStencilView2();
	void ClearDepthStencil2(ID3D10Device* device, ID3D10RenderTargetView* renderTargetView, float red, float green, float blue, float alpha);
	void SetDepthStencil2(ID3D10Device* device, ID3D10RenderTargetView* renderTargetView);
	bool buildDepthMap2(ID3D10Device* device, int textureWidth, int textureHeight);
private:
	ID3D10Texture2D* m_renderTargetTexture;
	ID3D10RenderTargetView* m_renderTargetView;
	ID3D10ShaderResourceView* m_shaderResourceView;

	ID3D10Texture2D* mDepthStencilTexture;
	ID3D10ShaderResourceView* mDepthMapSRV;
	ID3D10DepthStencilView* mDepthMapDSV;

	ID3D10Texture2D* mDepthStencilTexture2;
	ID3D10ShaderResourceView* mDepthMapSRV2;
	ID3D10DepthStencilView* mDepthMapDSV2;
};

#endif